API Documentation
Public Member Functions | List of all members
nkWinUi::ImageManager Class Referencefinal

Manages the images in the component. More...

Inheritance diagram for nkWinUi::ImageManager:

Public Member Functions

ImagecreateOrRetrieve (const nkMemory::StringView &name)
 
Imageget (const nkMemory::StringView &name) const
 
ImagegetByIndex (unsigned int index) const
 
void rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName)
 
void erase (const nkMemory::StringView &name)
 

Detailed Description

Manages the images in the component.

Member Function Documentation

◆ createOrRetrieve()

Image* nkWinUi::ImageManager::createOrRetrieve ( const nkMemory::StringView name)

Creates if unavailable, or retrieves if available, an image.

Parameters
nameThe name of the image to retrieve.
Returns
The image requested, possibly freshly created. The manager owns the memory returned, external code should never delete it. See erase().

◆ get()

Image* nkWinUi::ImageManager::get ( const nkMemory::StringView name) const

Retrieves an image.

Parameters
nameThe name of the image to retrieve.
Returns
The image requested if available, nullptr else.

◆ getByIndex()

Image* nkWinUi::ImageManager::getByIndex ( unsigned int  index) const

Get an image, by index. Note that one index can map to a different image after memory is changed. Useful to loop over all available images in one go.

Parameters
indexThe index of the image to retrieve.
Returns
The image linked if available, nullptr else.

◆ rename()

void nkWinUi::ImageManager::rename ( const nkMemory::StringView oldName,
const nkMemory::StringView newName 
)

Renames an image.

Parameters
oldNameThe name of the image to rename.
newNameThe name to reassign to the image.

◆ erase()

void nkWinUi::ImageManager::erase ( const nkMemory::StringView name)

Erases and frees an image.

Parameters
nameThe name of the image to erase.

The documentation for this class was generated from the following file: